package com.share.two.f_mysql_jdbc.b_dbcp;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import com.share.two.f_mysql_jdbc.entity.User;


@Service
public class UserDao {
	
	@Autowired
	JdbcTemplate jdbcTemplate;
	
	public void update(User user) {
		String sql = "update t_user set username=?,password=? where id =?";
		Object[] args = {user.getUsername(), user.getPassword(), user.getId()};
		jdbcTemplate.update(sql, args);
	}

}
